using System;
using Microsoft.SPOT;
using System.Diagnostics;

namespace Netduino4Fun.Framework.Log
{
    public class Log
    {
        IAppender appender;

        public Log(IAppender appender)
        {
            this.appender = appender;
        }


        public int Indentation { get; set; }


        public BlockLog BlockLog(string message)
        {
            return new BlockLog(this, message);
        }


        public void Write(string message)
        {
            string space = new string(' ', this.Indentation);
            this.appender.Write(space + message);
        }

        [Conditional("DEBUG")]
        public void WriteDebug(string message)
        {
            Write(message);
        }
    }
}
